import { i18nRender } from '@/locales';
const columns = [
  {
    title: i18nRender('upgradeLog.upgradeJobId'),
    dataIndex: 'upgradeJobId',
    dataIndex1: 'upgradeJobId',
    width: '6%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.userName'),
    dataIndex: 'userName',
    dataIndex1: 'userName',
    width: '10%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.bewrite'),
    dataIndex: 'bewrite',
    dataIndex1: 'bewrite',
    scopedSlots: { customRender: 'bewrite' },
    width: '13%',
    customHeaderCell: () => {
      return {
        style: {
          'text-align': 'center',
        },
      };
    },
  },
  {
    title: i18nRender('upgradeLog.targetVersion'),
    dataIndex: 'targetVersion',
    dataIndex1: 'targetVersion',
    width: '13%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.status'),
    dataIndex: 'status',
    dataIndex1: 'status',
    width: '5%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.createTime'),
    dataIndex: 'createTime',
    dataIndex1: 'createTime',
    width: '9%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.retryTimesLarge'),
    dataIndex: 'retryTimes',
    dataIndex1: 'retryTimesLarge',
    width: '7%',
    showColums: false,
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.beginDate'),
    dataIndex: 'beginDate',
    dataIndex1: 'beginDate',
    width: '7%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.upgradeTimeRange'),
    dataIndex: 'statusDesc',
    dataIndex1: 'upgradeTimeRange',
    width: '8%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.exec_status'),
    dataIndex: 'exec_status',
    dataIndex1: 'exec_status',
    scopedSlots: { customRender: 'execstatus' },
    width: '13%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.operate'),
    dataIndex: 'operate',
    dataIndex1: 'operate',
    scopedSlots: { customRender: 'operate' },
    width: '10%',
    align: 'center',
  },
];
const detailcolumns = [
  {
    title: i18nRender('upgradeLog.taskID'),
    dataIndex: 'upgradeJobId',
    dataIndex1: 'taskID',
    width: '8%',
    showColums: false,
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.deviceSn'),
    dataIndex: 'deviceSn',
    dataIndex1: 'deviceSn',
    width: '13%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.groupName'),
    dataIndex: 'groupName',
    dataIndex1: 'groupName',
    width: '13%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.upgradeStatus'),
    dataIndex: 'status',
    dataIndex1: 'upgradeStatus',
    scopedSlots: {
      filterDropdown: 'filterDropdown',
      filterIcon: 'filterIcon',
      customRender: 'status',
    },
    width: '9%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.statusDesc'),
    dataIndex: 'statusDesc',
    dataIndex1: 'statusDesc',
    width: '20%',
    align: 'center',
    scopedSlots: {
      customRender: 'statusDesc',
    },
  },
  {
    title: i18nRender('upgradeLog.diagnoseDesc'),
    dataIndex: 'diagnoseDesc',
    dataIndex1: 'diagnoseDesc',
    width: '18%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.version'),
    dataIndex: 'version',
    dataIndex1: 'version',
    width: '20%',
    scopedSlots: { customRender: 'version' },
    customHeaderCell: () => {
      return {
        style: {
          'text-align': 'center',
        },
      };
    },
  },
  {
    title: i18nRender('upgradeLog.retryTimes'),
    dataIndex: 'retryTimes',
    dataIndex1: 'retryTimes',
    showColums: false,
    width: '8%',
    align: 'center',
  },
  {
    title: i18nRender('upgradeLog.time'),
    dataIndex: 'time',
    dataIndex1: 'time',
    scopedSlots: { customRender: 'time' },
    width: '19%',
    customHeaderCell: () => {
      return {
        style: {
          'text-align': 'center',
        },
      };
    },
  },
  {
    title: i18nRender('upgradeLog.operate'),
    dataIndex: 'operate',
    dataIndex1: 'operate',
    scopedSlots: { customRender: 'operate' },
    width: '10%',
    align: 'center',
  },
];
const statusfilters = [
  {
    confEvent: '',
    desc: i18nRender('upgradeLog.all'),
    i18nIndex: 'all',
  },
  {
    confEvent: 'SUCCESS',
    desc: i18nRender('upgradeLog.success'),
    i18nIndex: 'success',
  },
  {
    confEvent: 'UNSTARTED',
    desc: i18nRender('upgradeLog.unstarted'),
    i18nIndex: 'unstarted',
  },
  {
    confEvent: 'FAILURE',
    desc: i18nRender('upgradeLog.failure'),
    i18nIndex: 'failure',
  },
  {
    confEvent: 'EXECUTING',
    desc: i18nRender('upgradeLog.executing'),
    i18nIndex: 'executing',
  },
  {
    confEvent: 'OFFLINE',
    desc: i18nRender('upgradeLog.offline'),
    i18nIndex: 'offline',
  },
  {
    confEvent: 'ABORT',
    desc: i18nRender('upgradeLog.abort'),
    i18nIndex: 'abort',
  },
  {
    confEvent: 'USERABORT',
    desc: i18nRender('upgradeLog.userbaort'),
    i18nIndex: 'userbaort',
  },
  // {
  //   confEvent: 'AUTO UPGRADE',
  //   desc: '自动升级成功',
  // },
];
export { columns, detailcolumns, statusfilters };
